package com.sh.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sh.dao.RroomrecordDao;
import com.sh.entity.Rroomrecord;
import com.sh.util.Result;

@RestController
public class RroomrecordController {
	@Autowired
	private RroomrecordDao rroomrecordDao;
	
	@RequestMapping("/selectRroomrecord")
	public Result getAll(Integer limit,Integer page,Rroomrecord rroomrecord,Map<String, Object> map) {
		map.put("page", (page - 1) * limit);
		map.put("limit", limit);
		List<Map<String, Object>> getRroomrecord = rroomrecordDao.getAll(map);
		Integer getCount = rroomrecordDao.getCount();
		Result res = new Result(0, "", getCount, getRroomrecord);
		return res;
	}
	
	@RequestMapping("/selects")
	public List getAlls() {
		List<Map<Object, Object>> getAlls = rroomrecordDao.getsAll();
		
		return getAlls;
	}
}
